<!DOCTYPE html>
<html lang=zh>
<head>
    <meta charset="utf-8">
    
    <title>睡不醒的黑客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="@keyframes rotate {         0% {             transform: rotate(0deg);         }          100% {             transform: rotate(360deg);         }     }      @keyframes slideUpFadeIn {         0%">
<meta property="og:type" content="website">
<meta property="og:title" content="睡不醒的黑客">
<meta property="og:url" content="https://hq229075284.github.io/blog/github/index.html">
<meta property="og:site_name" content="睡不醒的黑客">
<meta property="og:description" content="@keyframes rotate {         0% {             transform: rotate(0deg);         }          100% {             transform: rotate(360deg);         }     }      @keyframes slideUpFadeIn {         0%">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-08-31T01:14:15.551Z">
<meta property="article:modified_time" content="2022-08-31T01:14:15.551Z">
<meta property="article:author" content="HanQ">
<meta name="twitter:card" content="summary">
    

    

    

    
<link rel="stylesheet" href="/blog/libs/font-awesome/css/font-awesome.min.css">

    
<link rel="stylesheet" href="/blog/libs/open-sans/styles.css">

    
<link rel="stylesheet" href="/blog/libs/source-code-pro/styles.css">


    
<link rel="stylesheet" href="/blog/css/style.css">


    
<script src="/blog/libs/jquery/2.1.3/jquery.min.js"></script>

    
    
        
<link rel="stylesheet" href="/blog/libs/lightgallery/css/lightgallery.min.css">

    
    
        
<link rel="stylesheet" href="/blog/libs/justified-gallery/justifiedGallery.min.css">

    
    
    
    
        <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?c5e2de02c4aac83227b728f6dc16f902";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>

    


<meta name="generator" content="Hexo 4.2.1"></head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/blog/" id="logo">
                <i class="logo"></i>
                <span class="site-title">睡不醒的黑客</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="/blog/.">首页</a>
                
                    <a class="main-nav-link" href="/blog/archives">归档</a>
                
                    <a class="main-nav-link" href="/blog/github">GitHub仓库</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/blog/images/IMG_0049.JPG" />
                            <i class="fa fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/blog/',
        CONTENT_URL: '/blog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/blog/js/insight.js"></script>


</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="/blog/.">首页</a></td>
                
                    <td><a class="main-nav-link" href="/blog/archives">归档</a></td>
                
                    <td><a class="main-nav-link" href="/blog/github">GitHub仓库</a></td>
                
                <td>
                    
    <div class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
    </div>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
            <section id="main" style="width: 100%;"><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.min.css">
<style>
    @keyframes rotate {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    @keyframes slideUpFadeIn {
        0% {
            opacity: 0;
            transform: translateY(80px);
        }

        100% {
            opacity: 1;
            transform: translateY(0px);
        }
    }

    .loading {
        text-align: center;
        padding-top: 20px;
    }

    .loading::before {
        content: '';
        vertical-align: middle;
        border: 1px solid #bec0c1;
        width: 14px;
        height: 14px;
        box-sizing: border-box;
        display: inline-block;
        border-radius: 50%;
        border-right-color: transparent;
        animation: rotate 1s linear infinite both;
        margin-right: 8px;
    }

    .slideUpFadeIn {
        animation: slideUpFadeIn 0.5s ease-in both;
    }
</style>
<div class="repository-container" style="line-height: 1.5;">
    <div class="loading">loading...</div>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.0/axios.min.js"></script>
    <script>
        let page = 1
        const pageSize = 100
        const token = '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'
        function getList(prevData = []) {
            return axios({
                url: `https://api.github.com/user/repos`,
                method: 'get',
                params: {
                    accept: 'application/vnd.github.v3+json',
                    sort: 'created',
                    direction: 'desc',
                    page: page,
                    per_page: pageSize,
                    since:new Date('2010-01-01 00:00:00').toISOString(),
                    before:new Date().toISOString()
                },
                headers: {
                    Authorization: 'token '+token
                }
            }).then(({ data }) => {
                prevData = prevData.concat(data)
                if (prevData.length < page * pageSize) {
                    return Promise.resolve(prevData)
                }
                page += 1
                return getList(prevData)
            })
        }

        function setStyle(dom, styles) {
            for (let property in styles) {
                const attribute = styles[property]
                dom.style[property] = attribute
            }
        }

        const classifyMap = {
            // 最新添加
            new: {
                title: '最新添加',
                list: []
            },
            // 维护中
            maintenance: {
                title: '维护中',
                list: []
            },
            // fork
            fork: {
                title: 'fork',
                list: []
            },
            // other
            other: {
                title: '未分类',
                list: []
            }
        }

        function generateContentBySort(data) {
            const ul = document.createElement('ul')
            if (data.length === 0) {
                const div = document.createElement('div')
                div.textContent = '暂无数据'
                setStyle(div, {
                    'text-align': 'center',
                    padding: '10px'
                })
                return div
            }
            data.map(one => {
                const li = document.createElement('li')
                setStyle(li, {
                    display: 'inline-block',
                    width: '33%',
                    padding: '4px',
                    'box-sizing': 'border-box',
                    'word-break': 'break-all',
                    'vertical-align': 'top',
                    height: '160px'
                })

                const a = document.createElement('a')
                setStyle(a, {
                    borderRadius: '10px',
                    backgroundColor: '#fff',
                    height: '100%',
                    'box-shadow': '0 0 2px #eceff2',
                    display: 'block'
                })
                a.href = one.html_url
                a.target = '_blank'
                li.append(a)

                let div
                div = document.createElement('div')
                div.textContent = one.name
                div.setAttribute('title', one.name)
                setStyle(div, {
                    padding: '10px',
                    'font-size': '24px',
                    'font-weight': 700,
                    'border-bottom': '1px solid #eceff2',
                    'white-space': 'nowrap',
                    'text-overflow': 'ellipsis',
                    'overflow': 'hidden'
                })
                a.append(div)

                div = document.createElement('div')
                div.textContent = one.description
                setStyle(div, {
                    padding: '10px',
                    'font-size': '14px',
                    'color': '#585858'
                })
                a.append(div)

                ul.append(li)
            })
            return ul
        }

        function isMatch(regList, str) {
            for (r of regList) {
                const reg = new RegExp(r)
                if (reg.test(str)) {
                    return true
                }
            }
            return false
        }

        const maintenanceRegs = [
            'eslint-config',
            'file-split',
            'blog',
            'comet-test',
            'react-ssr-test',
            'test-component',
            'image-view-component',
            'usualAlgorithm',
            'about-common-logic',
            'blog',
            'blog-assets',
        ]

        getList().then(data => {
            classifyMap.new.list = data.splice(0, 12)
            data.forEach(one => {
                if (one.fork) {
                    classifyMap.fork.list.push(one)
                    return
                }
                if (isMatch(maintenanceRegs, one.name)) {
                    classifyMap.maintenance.list.push(one)
                    return
                }
                classifyMap.other.list.push(one)
            })
            $repositoryContainer = document.querySelector('.repository-container')
            $repositoryContainer.children[0].remove()
            for (let key in classifyMap) {
                const h2 = document.createElement('h2')
                // const a=document.createElement('a')
                // a.setAttribute('id',key)
                // a.href="#"+key
                // a.textContent = classifyMap[key].title+'('+classifyMap[key].list.length+')'
                // h2.append(a)
                h2.textContent = classifyMap[key].title + ' (' + classifyMap[key].list.length + ')'
                setStyle(h2, {
                    padding: '10px',
                    'margin-bottom': '4px',
                    'border-bottom': '1px solid #eceff2',
                    'font-size': '24px'
                })
                $repositoryContainer.append(h2)
                const contentHtmlNode = generateContentBySort(classifyMap[key].list)
                $repositoryContainer.append(contentHtmlNode)
            }
            $repositoryContainer.classList.add('slideUpFadeIn')
        })
        void 0
    </script>
</div></section>
            
        </div>
        <footer id="footer">
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2022 HanQ<br>
            Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice" target="_blank" rel="noopener">PPOffice</a>
        </div>
    </div>
</footer>
        


    
        
<script src="/blog/libs/lightgallery/js/lightgallery.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-thumbnail.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-pager.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-autoplay.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-fullscreen.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-zoom.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-hash.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-share.min.js"></script>

        
<script src="/blog/libs/lightgallery/js/lg-video.min.js"></script>

    
    
        
<script src="/blog/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>

    
    



<!-- Custom Scripts -->

<script src="/blog/js/main.js"></script>


    </div>
</body>
</html>